﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Plugin.TradeSharp
{
    public partial class FormRiskSetting : Form
    {
        public FormRiskSetting()
        {
            InitializeComponent();
            comboBox_NotifyWay.Items.Add("弹出消息框");
            comboBox_NotifyWay.Items.Add("发出提示音");
            comboBox_NotifyWay.Items.Add("发出电子邮件");
            radioButtonOpeNone.Checked = true;

        }

        private void btn_OK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.textBox1.Text))
            {
                MessageBox.Show(this, "请输入风控单位净资产值");
                this.textBox1.Focus();
                return;
            }

            double val = 0.0;
            
            try
            {
                val  = double.Parse(this.textBox1.Text);
                if (val <= 0)
                {
                    MessageBox.Show(this, "请输入风控单位净资产值");
                    return;
                }
            }
            catch (System.Exception )
            {
                MessageBox.Show(this, "请输入风控单位净资产值");
            	return;
            }
            ClientTradeRisk.Instance.UintNetValueRiskControlEnable = radioButton_AllClear.Checked;// this.checkBox1.Checked;
            
            
            ClientTradeRisk.Instance.Price = val;
            ClientTradeRisk.Instance.UintNetValueRiskControlEnable = radioButton_AllClear.Checked;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void btn_Setting_Click(object sender, EventArgs e)
        {

        }
    }
}
